package org.gdpi.ssh.entitys;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "t_specialty")
public class Specialty implements Serializable {

	@Transient
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	@Column(name = "specialty_id")
	private Integer specialtyId;

	@Column(name = "specialty_name")
	private String specialtyName;

	@Column(name = "specialty_desc")
	private String specialtyDesc;

	@OneToMany(mappedBy = "specialty", fetch = FetchType.EAGER)
	private Set<Grade> grades;

	public Specialty() {
		super();
	}

	public Specialty(Integer specialtyId, String specialtyName, String specialtyDesc) {
		super();
		this.specialtyId = specialtyId;
		this.specialtyName = specialtyName;
		this.specialtyDesc = specialtyDesc;
	}

	public Integer getSpecialtyId() {
		return specialtyId;
	}

	public void setSpecialtyId(Integer specialtyId) {
		this.specialtyId = specialtyId;
	}

	public String getSpecialtyName() {
		return specialtyName;
	}

	public void setSpecialtyName(String specialtyName) {
		this.specialtyName = specialtyName;
	}

	public String getSpecialtyDesc() {
		return specialtyDesc;
	}

	public void setSpecialtyDesc(String specialtyDesc) {
		this.specialtyDesc = specialtyDesc;
	}

	public Set<Grade> getGrades() {
		return grades;
	}

	public void setGrades(Set<Grade> grades) {
		this.grades = grades;
	}

	@Override
	public String toString() {
		return "Specialty [specialtyId=" + specialtyId + ", specialtyName=" + specialtyName + ", specialtyDesc="
				+ specialtyDesc + ", grades=" + grades.size() + "]";
	}

}
